﻿using System.Collections.Generic;

namespace com.binance.client
{

	 
	using CandlestickInterval = com.binance.client.model.enums.CandlestickInterval;
	using AggregateTradeEvent = com.binance.client.model.@event.AggregateTradeEvent;
	using CandlestickEvent = com.binance.client.model.@event.CandlestickEvent;
	using LiquidationOrderEvent = com.binance.client.model.@event.LiquidationOrderEvent;
	using MarkPriceEvent = com.binance.client.model.@event.MarkPriceEvent;
	using OrderBookEvent = com.binance.client.model.@event.OrderBookEvent;
	using SymbolBookTickerEvent = com.binance.client.model.@event.SymbolBookTickerEvent;
	using SymbolMiniTickerEvent = com.binance.client.model.@event.SymbolMiniTickerEvent;
	using SymbolTickerEvent = com.binance.client.model.@event.SymbolTickerEvent;
	using UserDataUpdateEvent = com.binance.client.model.user.UserDataUpdateEvent;

	/// <summary>
	///*
	/// The subscription client interface, it is used for subscribing any market data
	/// update and account change, it is asynchronous, so you must implement the
	/// SubscriptionListener interface. The server will push any update to the
	/// client. if client get the update, the onReceive method will be called.
	/// </summary>
	public interface SubscriptionClient
	{
		/// <summary>
		/// Create the subscription client to subscribe the update from server.
		/// </summary>
		/// <returns> The instance of synchronous client. </returns>
//JAVA TO C# CONVERTER TODO TASK: There is no equivalent in C# to Java static interface methods:
//		static SubscriptionClient create()
	//	{
	//		return create("", "", new SubscriptionOptions());
	//	}

		/// <summary>
		/// Create the subscription client to subscribe the update from server.
		/// </summary>
		/// <param name="apiKey">    The public key applied from Binance. </param>
		/// <param name="secretKey"> The private key applied from Binance. </param>
		/// <returns> The instance of synchronous client. </returns>
//JAVA TO C# CONVERTER TODO TASK: There is no equivalent in C# to Java static interface methods:
//		static SubscriptionClient create(String apiKey, String secretKey)
	//	{
	//		return BinanceApiInternalFactory.getInstance().createSubscriptionClient(apiKey, secretKey, new SubscriptionOptions());
	//	}

		/// <summary>
		/// Create the subscription client to subscribe the update from server.
		/// </summary>
		/// <param name="apiKey">              The public key applied from Binance. </param>
		/// <param name="secretKey">           The private key applied from Binance. </param>
		/// <param name="subscriptionOptions"> The option of subscription connection, see
		///                            <seealso cref="SubscriptionOptions"/> </param>
		/// <returns> The instance of synchronous client. </returns>
//JAVA TO C# CONVERTER TODO TASK: There is no equivalent in C# to Java static interface methods:
//		static SubscriptionClient create(String apiKey, String secretKey, SubscriptionOptions subscriptionOptions)
	//	{
	//		return BinanceApiInternalFactory.getInstance().createSubscriptionClient(apiKey, secretKey, subscriptionOptions);
	//	}

		/// <summary>
		/// Unsubscribe all subscription.
		/// </summary>
		void unsubscribeAll();

		/// <summary>
		/// Subscribe aggregate trade event. If the aggregate trade is updated,
		/// server will send the data to client and onReceive in callback will be called.
		/// </summary>
		/// <param name="symbol">      The symbol, like "btcusdt". </param>
		/// <param name="callback">     The implementation is required. onReceive will be called
		///                     if receive server's update. </param>
		/// <param name="errorHandler"> The error handler will be called if subscription failed
		///                     or error happen between client and Binance server. </param>
		void subscribeAggregateTradeEvent(string symbol, SubscriptionListener<AggregateTradeEvent> callback, SubscriptionErrorHandler errorHandler);

		/// <summary>
		/// Subscribe mark price event. If the mark price is updated,
		/// server will send the data to client and onReceive in callback will be called.
		/// </summary>
		/// <param name="symbol">      The symbol, like "btcusdt". </param>
		/// <param name="callback">     The implementation is required. onReceive will be called
		///                     if receive server's update. </param>
		/// <param name="errorHandler"> The error handler will be called if subscription failed
		///                     or error happen between client and Binance server. </param>
		void subscribeMarkPriceEvent(string symbol, SubscriptionListener<MarkPriceEvent> callback, SubscriptionErrorHandler errorHandler);

		/// <summary>
		/// Subscribe candlestick event. If the candlestick is updated,
		/// server will send the data to client and onReceive in callback will be called.
		/// </summary>
		/// <param name="symbol">      The symbol, like "btcusdt". </param>
		/// <param name="interval">      The candlestick interval, like "ONE_MINUTE". </param>
		/// <param name="callback">     The implementation is required. onReceive will be called
		///                     if receive server's update. </param>
		/// <param name="errorHandler"> The error handler will be called if subscription failed
		///                     or error happen between client and Binance server. </param>
		void subscribeCandlestickEvent(string symbol, CandlestickInterval interval, SubscriptionListener<CandlestickEvent> callback, SubscriptionErrorHandler errorHandler);

		/// <summary>
		/// Subscribe individual symbol mini ticker event. If the symbol mini ticker is updated,
		/// server will send the data to client and onReceive in callback will be called.
		/// </summary>
		/// <param name="symbol">      The symbol, like "btcusdt". </param>
		/// <param name="callback">     The implementation is required. onReceive will be called
		///                     if receive server's update. </param>
		/// <param name="errorHandler"> The error handler will be called if subscription failed
		///                     or error happen between client and Binance server. </param>
		void subscribeSymbolMiniTickerEvent(string symbol, SubscriptionListener<SymbolMiniTickerEvent> callback, SubscriptionErrorHandler errorHandler);

		/// <summary>
		/// Subscribe all market mini tickers event. If the mini tickers are updated,
		/// server will send the data to client and onReceive in callback will be called.
		/// </summary>
		/// <param name="callback">     The implementation is required. onReceive will be called
		///                     if receive server's update. </param>
		/// <param name="errorHandler"> The error handler will be called if subscription failed
		///                     or error happen between client and Binance server. </param>
		void subscribeAllMiniTickerEvent(SubscriptionListener<IList<SymbolMiniTickerEvent>> callback, SubscriptionErrorHandler errorHandler);

		/// <summary>
		/// Subscribe individual symbol ticker event. If the symbol ticker is updated,
		/// server will send the data to client and onReceive in callback will be called.
		/// </summary>
		/// <param name="symbol">      The symbol, like "btcusdt". </param>
		/// <param name="callback">     The implementation is required. onReceive will be called
		///                     if receive server's update. </param>
		/// <param name="errorHandler"> The error handler will be called if subscription failed
		///                     or error happen between client and Binance server. </param>
		void subscribeSymbolTickerEvent(string symbol, SubscriptionListener<SymbolTickerEvent> callback, SubscriptionErrorHandler errorHandler);

		/// <summary>
		/// Subscribe all market tickers event. If the tickers are updated,
		/// server will send the data to client and onReceive in callback will be called.
		/// </summary>
		/// <param name="callback">     The implementation is required. onReceive will be called
		///                     if receive server's update. </param>
		/// <param name="errorHandler"> The error handler will be called if subscription failed
		///                     or error happen between client and Binance server. </param>
		void subscribeAllTickerEvent(SubscriptionListener<IList<SymbolTickerEvent>> callback, SubscriptionErrorHandler errorHandler);

		/// <summary>
		/// Subscribe individual symbol book ticker event. If the symbol book ticker is updated,
		/// server will send the data to client and onReceive in callback will be called.
		/// </summary>
		/// <param name="symbol">      The symbol, like "btcusdt". </param>
		/// <param name="callback">     The implementation is required. onReceive will be called
		///                     if receive server's update. </param>
		/// <param name="errorHandler"> The error handler will be called if subscription failed
		///                     or error happen between client and Binance server. </param>
		void subscribeSymbolBookTickerEvent(string symbol, SubscriptionListener<SymbolBookTickerEvent> callback, SubscriptionErrorHandler errorHandler);

		/// <summary>
		/// Subscribe all market book tickers event. If the book tickers are updated,
		/// server will send the data to client and onReceive in callback will be called.
		/// </summary>
		/// <param name="callback">     The implementation is required. onReceive will be called
		///                     if receive server's update. </param>
		/// <param name="errorHandler"> The error handler will be called if subscription failed
		///                     or error happen between client and Binance server. </param>
		void subscribeAllBookTickerEvent(SubscriptionListener<SymbolBookTickerEvent> callback, SubscriptionErrorHandler errorHandler);

		/// <summary>
		/// Subscribe individual symbol book ticker event. If the symbol book ticker is updated,
		/// server will send the data to client and onReceive in callback will be called.
		/// </summary>
		/// <param name="symbol">      The symbol, like "btcusdt". </param>
		/// <param name="callback">     The implementation is required. onReceive will be called
		///                     if receive server's update. </param>
		/// <param name="errorHandler"> The error handler will be called if subscription failed
		///                     or error happen between client and Binance server. </param>
		void subscribeSymbolLiquidationOrderEvent(string symbol, SubscriptionListener<LiquidationOrderEvent> callback, SubscriptionErrorHandler errorHandler);

		/// <summary>
		/// Subscribe all market book tickers event. If the book tickers are updated,
		/// server will send the data to client and onReceive in callback will be called.
		/// </summary>
		/// <param name="callback">     The implementation is required. onReceive will be called
		///                     if receive server's update. </param>
		/// <param name="errorHandler"> The error handler will be called if subscription failed
		///                     or error happen between client and Binance server. </param>
		void subscribeAllLiquidationOrderEvent(SubscriptionListener<LiquidationOrderEvent> callback, SubscriptionErrorHandler errorHandler);

		/// <summary>
		/// Subscribe partial book depth event. If the book depth is updated,
		/// server will send the data to client and onReceive in callback will be called.
		/// </summary>
		/// <param name="symbol">      The symbol, like "btcusdt". </param>
		/// <param name="limit">         The limit. </param>
		/// <param name="callback">     The implementation is required. onReceive will be called
		///                     if receive server's update. </param>
		/// <param name="errorHandler"> The error handler will be called if subscription failed
		///                     or error happen between client and Binance server. </param>
		void subscribeBookDepthEvent(string symbol, int? limit, SubscriptionListener<OrderBookEvent> callback, SubscriptionErrorHandler errorHandler);

		/// <summary>
		/// Subscribe diff depth event. If the book depth is updated,
		/// server will send the data to client and onReceive in callback will be called.
		/// </summary>
		/// <param name="symbol">      The symbol, like "btcusdt". </param>
		/// <param name="callback">     The implementation is required. onReceive will be called
		///                     if receive server's update. </param>
		/// <param name="errorHandler"> The error handler will be called if subscription failed
		///                     or error happen between client and Binance server. </param>
		void subscribeDiffDepthEvent(string symbol, SubscriptionListener<OrderBookEvent> callback, SubscriptionErrorHandler errorHandler);

		/// <summary>
		/// Subscribe user data event. If the user data is updated,
		/// server will send the data to client and onReceive in callback will be called.
		/// </summary>
		/// <param name="listenKey">      The listenKey. </param>
		/// <param name="callback">     The implementation is required. onReceive will be called
		///                     if receive server's update. </param>
		/// <param name="errorHandler"> The error handler will be called if subscription failed
		///                     or error happen between client and Binance server. </param>
		void subscribeUserDataEvent(string listenKey, SubscriptionListener<UserDataUpdateEvent> callback, SubscriptionErrorHandler errorHandler);


	}

}